import Vue from 'vue'
import resource from 'vue-resource'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import login from './login.vue'
Vue.use(resource)
Vue.use(ElementUI)

//判断有没有登录
if(localStorage.token){
  //登录成功  
  //全局设置token请求头
  Vue.http.headers.common['Authorization'] = localStorage.token
}else{
  //登录失败
  location.href='./login.html'
}
new Vue({
  el: '#app',
  render: h => h(login)
})
